<template>
  <h1>这是 detail 组件</h1>
  <Child :msg="msg" @send="send" />  <!-- :msg 不填写则返回默认值 -->

</template>

<script>
import {defineComponent, ref} from "vue"; import Child from "../components/Child";

export default defineComponent({
  name: "Detail",
  components: {
    Child
  },
  setup(){
    let msg = ref('这是父组件的数据')
    let send = (val) => {
      console.log(val)
    }

    return{
      msg,
      send,
    }
  }
})
</script>

<style scoped>

</style>
